﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace OF.Utility.Logging
{
    /// <summary>
    /// 原生log4net
    /// </summary>
   public class Log4netLog
    {
        /// <summary>
        /// 行为日志
        /// </summary>
        /// <param name="accessInfo"></param>
        public static void Info(ActionLog accessInfo)
        {
            ILog logger = LogManager.GetLogger("ActionLogAdoAppenderLogger");
            if(logger.IsInfoEnabled)
                logger.Info(accessInfo);
        }

        /// <summary>
        /// 错误日志日志
        /// </summary>
        /// <param name="errorLog"></param>
        public static void Error(ErrorLog errorLog)
        {
            ILog logger = LogManager.GetLogger("ErrorLogAdoNetAppenderLogger");
            if (logger.IsErrorEnabled)
                logger.Error(errorLog);
        }


        /// <summary>
        /// 文件日志
        /// </summary>
        /// <param name="message"></param>
        public static void Debug(string message)
        {
            ILog logger = LogManager.GetLogger("DebugLogTxtAppenderLogger");
            logger.Fatal(message);
        }

     
    }
}
